package mvc.effects.impl;


import java.util.LinkedList;
import java.util.List;

import mvc.core.impl.MachuImage;
import mvc.effects.IEffect;

public class EffectsHandler {
	
	
	private List<IEffect> listWithEffects;
	
	//Very subject to change
	public EffectsHandler(){
		listWithEffects = new LinkedList<IEffect>();
		setListWithEffects(); 
		
	}
	
	
	public void addEffect(MachuImage img, IEffect effect){
		img.getEffectsList().add(effect);
	}
	
	public void removeLastEffect(MachuImage img){
		img.getEffectsList().remove(img.getEffectsList().size() -1);
	}
	
	private void setListWithEffects(){
		// TODO Design a better way of adding effects to effectshandler 
		//or another way to obtain effects somewhere
		listWithEffects.add(new GrayscaleEffect());
		listWithEffects.add(new HorizontalFlipEffect());
		listWithEffects.add(new InvertEffect());
		listWithEffects.add(new Rotate180Effect());
		listWithEffects.add(new VerticalFlipEffect());
		
	}
	
	public MachuImage applyEffect(MachuImage img){
		return null;
	}	

	public List<IEffect> getListWithEffects() {
		// TODO create a way to get effects. See setListWithEffects();
		return listWithEffects;
	}
}
